<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="exam:exarrange:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="exam:exarrange:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="exam:exarrange:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exam:exarrange:export">
						<i class="fa fa-download"></i> 导出
				 </a>-->
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "exam/exarrange";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add/"+[[${ksid}]],
                updateUrl: prefix + "/edit/{id}",
                detailUrl: prefix + "/detail/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "排考抽题",
                queryParams:{"ksid":[[${ksid}]]},
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'uid', 
					title : '考生号'
				},
				{
					field : 'kmid', 
					title : '科目'
				},
				{
					field : 'ksid', 
					title : '考试号'
				},
				/* {
					field : 'paperdata', 
					title : '分类题号集合',
					sortable: true
				}, */
				{
					field : 'pc', 
					title : '批次',
					sortable: true
				},
				{
					field : 'kch', 
					title : '考场号',
					sortable: true
				},
				{
					field : 'loginip', 
					title : '指定IP',
					sortable: true
				},
				{
					field : 'starttime', 
					title : '具体开始时间'
				},
				{
					field : 'endtime', 
					title : '具体结束时间'
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.operate.edit(\'' + row.uid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.uid + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="$.operate.detail(\'' + row.uid + '\')"><i class="fa fa-search"></i>详细</a>');
                        return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>